package com.niit.service.impl;

import com.niit.dao.AdminMapper;
import com.niit.pojo.Admin;
import com.niit.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;


    @Override
    public int addAdmin(Admin admin) {
        return adminMapper.addAdmin(admin);
    }



    @Override
    public List<Admin> queryAdmin(Admin admin) {
        // 调用UserMapper查询用户
        List<Admin> queriedAdmin = adminMapper.query(admin);
        return queriedAdmin;
    }

    @Override
    public int deleteAdmin(int adminId) {
        return adminMapper.deleteAdmin(adminId);
    }

    @Override
    public int updateAdmin(Admin admin) {
        return adminMapper.updateAdmin(admin);
    }

    @Override
    public Admin queryAdmin(int adminId) {
        return adminMapper.queryAdminById(adminId);
    }
}
